<extend name="Public:base" />
<!-- 网站标题 -->
<block name="title">问卷管理</block>
<block name="appendheader">
	<!-- 删除确认插件 --> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/jquery.artDialog.js?skin=default"></script> 
	<script type="text/javascript" src="__PUBLIC__/artDialog/iframeTools.js"></script> 
	<script type="text/javascript" src="__PUBLIC__/common/js/list.js"></script>
	
	<!--编辑器js引入-->
	<script type="text/javascript">
		var UEDITOR_HOME_URL = '__PUBLIC__/ueditor/',ueditor_loader={};
		var MEDIA_OBJID = 'Web/{$Think.cookie.webid}{$Think.config.UEDITOR_PATH}';
	</script>
	<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script> 
	
	<!-- 拖动排序 -->
	<script type="text/javascript" src="__PUBLIC__/common/js/jquery-ui.js"></script>
	<script src="../Public/js/sortable.js"></script>
	<!-- 选中当前菜单引入 -->
	<script type="text/javascript">
		$(function() {
			//特别注意：
			//在模态窗口中异步加载的内容只有第一次传递参数值是合适的，在不刷新页面的情况下以后的加载都直接从缓存中读取
			//为避免此类bug，在每次关闭模态窗口时在回调函数中刷新整个网页（songyb 2015-08-18）
			$('#logic_set').on('hidden.bs.modal', function (e) {
				location.reload(true);
			});	
		});
	
		$(function() {
			$("#WebMenu-2000").addClass('active');	//选中父菜单
			$("#WebMenu-2009").addClass('active');	//选中当前菜单
		});
		
		//拖拽排序时将显示顺序更新至数据库
		$(function(){
			var activityid = $("input[name='testid']").val();
			test_sort('{$test_data.id}', "?g=Admin&m=QuestionTestEdit&a=update_modseq");
		});
	</script>
	<style type="text/css">
		/*题型样式*/
		.ac_test { border:1px solid #E8E8E8; margin-bottom:20px; padding:0 10px }
		.ac_test .module-title { position:relative; height:30px;}
		.ac_test .module-title h5 { margin-top:10px; height:30px; line-height:30px; }
		.ac_test .module-title .toolbar { line-height:30px; position:absolute; top:0; right:0; }
		.ac_test .module-title .toolbar span { margin-right:20px; }
		.ac_test .module-body { padding:5px 5px 10px; }
		.ac_test .module-body .video-player { padding:10px 20px; }
		
		.question-title { font-size:16px; color:#02B980; }
		.switch-handle a { color:#02B980; }
		.switch-content { display:none; }
	</style>
</block>
<!-- 当前位置 -->
<block name="breadcrumb">
	<div class="page-header pull-left">
		<div class="page-title">问卷管理</div>
	</div>
	<ol class="breadcrumb page-breadcrumb pull-left">
		<li><i class="fa fa-home"></i>&nbsp;<a href="__APP__?g=Admin">首页</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">基础数据</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li class="active">问卷管理</li>
	</ol>
</block>
<block name="main_content">
	<div class="panel panel-default">
		<div class="panel-heading">
			<!-- <h3 class="panel-title fl">{$test_data.title}</h3> -->
			<div class="btn-add-content">
				<a href="__APP__?g=Admin&m=Form&a=index" class="btn btn-default"><i class="fa fa-reply"></i>返回</a>&nbsp;&nbsp;
				<eq name="test_data.status" value="a">
					<a href="__APP__?g={:GROUP_NAME}&m=CourseTest&a=release&courseid={$Think.request.courseid}" class="btn btn-warning"><i class="fa fa-check"></i>发布</a>&nbsp;&nbsp;
				<else/>
					<a href="__APP__?g={:GROUP_NAME}&m=CourseTest&a=release&courseid={$Think.request.courseid}" class="btn btn-warning"><i class="fa fa-times"></i>取消发布</a>&nbsp;&nbsp;
				</eq>				
				<div class="btn-group " style="align:right">
					<a href="javascript:void(0)" data-toggle="dropdown" class="btn btn-success dropdown-toggle"><i class="fa fa-plus"></i>添加题目&nbsp;<span class="caret"></span></a>
					<ul role="menu" class="dropdown-menu">
						<li><a href="__APP__?g={:GROUP_NAME}&m=QuestionTestSelect&a=add&formid={$Think.request.formid}"><i class="fa fa-check-square-o"></i>选择题</a></li>
						<li><a href="__APP__?g={:GROUP_NAME}&m=Affix&a=add&formid={$Think.request.formid}"><i class="fa fa-upload"></i>附件题</a></li>
						<li><a href="__APP__?g={:GROUP_NAME}&m=Blank&a=add&formid={$Think.request.formid}"><i class="fa fa-file-text"></i>填空题</a></li>
<!--						<li><a href="__APP__?g={:GROUP_NAME}&m=ComSelect&a=add&formid={$Think.request.formid}"><i class="fa fa-check-circle "></i>常用选择器</a></li>-->
					</ul>
				</div>&nbsp;&nbsp;
				<a href="__APP__?g=Index&m=Form&a=view&formid={$Think.request.formid}&user_type=admin" class="btn btn-success" target="_blank"><i class="fa fa-eye"></i>预览</a>&nbsp;&nbsp;
			</div>
		</div>
		<div class="panel-body">
			<form id="myform" action="#" method="post" class="form-horizontal" enctype="multipart/form-data">
				<input type="hidden" name="testid" value="{$test_data.id}" />
				<h3 class="text-center">{$test_data.title}</h3>
				<div class="mt-20 mb-20">{$test_data.intro}</div>
				<hr/>
				<div class="block_{$test_data.id}">
					<volist name="test_data.item_list" id="vo" key="k">
						<if condition="$vo.item_type eq 'select'">
							<!-- 选择题 -->
							<include file="item_select_edit" />
						<elseif condition="$vo.item_type eq 'judge'" />
							<!--判断题 -->
							<include file="item_judge_edit" />
						<elseif condition="$vo.item_type eq 'desc'" />
							<!-- 描述题 -->
							<include file="item_desc_edit" />
						<elseif condition="$vo.item_type eq 'blank'" />
							<!-- 填空题 -->
							<include file="item_blank_edit" />
						<elseif condition="$vo.item_type eq 'affix'" />
							<!-- 附件题 -->
							<include file="item_affix_edit" />
						<elseif condition="$vo.item_type eq 'comSelect'" />
							<!-- 常用选择器 -->
							<include file="item_com_select_edit" />
						</if>
					</volist>
				</div>
				
				<empty name="test_data.item_info"><p class="text-center text-gray">尚未添加任何题目</p></empty>
			</form>
		</div>		
		<!-- 互斥项设置 -->
		<div style="display:none;" id="logic_set" tabindex="-1" role="dialog" aria-labelledby="modal-responsive-label" aria-hidden="true" class="modal fade">
			<div class="modal-dialog modal-lg">
				<div class="modal-content"></div>
			</div>
		</div>
	</div>	
</block>